function asyncConfirm(message) {
	return new Promise((resolve, reject) => {
		// 创建覆盖层
		const overlay = document.createElement('div');
		overlay.style.cssText = `
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0,0,0,0.5);
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 999;
    `;

		// 创建对话框容器
		const dialog = document.createElement('div');
		dialog.style.cssText = `
      background: white;
      padding: 20px;
      border-radius: 8px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.33);
      min-width: 300px;
    `;

		// 创建消息内容
		const messageEl = document.createElement('div');
		messageEl.textContent = message;
		messageEl.style.marginBottom = '15px';

		// 创建按钮容器
		const buttons = document.createElement('div');
		buttons.style.cssText = `
      display: flex;
      gap: 10px;
      justify-content: flex-end;
      margin-top: 15px;
    `;

		// 创建确认按钮
		const confirmBtn = document.createElement('button');
		confirmBtn.textContent = '确认';
		confirmBtn.style.cssText = `
      padding: 8px 16px;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      background: #4CAF50;
      color: white;
    `;

		// 创建取消按钮
		const cancelBtn = document.createElement('button');
		cancelBtn.textContent = '取消';
		cancelBtn.style.cssText = `
      padding: 8px 16px;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      background: #f44336;
      color: white;
    `;

		// 组装组件
		buttons.appendChild(confirmBtn);
		buttons.appendChild(cancelBtn);
		dialog.appendChild(messageEl);
		dialog.appendChild(buttons);
		overlay.appendChild(dialog);

		// 事件处理
		const close = () => {
			document.body.removeChild(overlay);
		};

		confirmBtn.addEventListener('click', () => {
			close();
			resolve(true);
		});

		cancelBtn.addEventListener('click', () => {
			close();
			resolve(false);
		});

		overlay.addEventListener('click', (e) => {
			if (e.target === overlay) {
				close();
				resolve(false);
			}
		});

		// 添加到页面
		document.body.appendChild(overlay);
	});
}

// 使用示例
async function showDialog(title) {
	const result = await asyncConfirm(title); 
    automaSetVariable('jsResult', result);
	automaNextBlock();
}